<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <title>添加/修改页面</title>
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <link rel="stylesheet" href="../../../component/elementUI/index.css">
    <link rel="stylesheet" href="../../../component/pear/css/pear.css" />
    <link rel="stylesheet" href="../../../style/wangeditor.css">
    <link rel="stylesheet" href="../../../style/index.css">
</head>

<body>
    <div id="app" v-cloak>
        <div class="add">
            <div class="header">
                <span>{{(action == 'Add'?'添加':'修改')}}商户管理</span>
            </div>
            <div class="main" style="padding: 0 15px;">
                <!-- 配置属性, 目前仅支持 单主表 多子表 结构 -->
                <div id="form"
                    :data-options="JSON.stringify({'tableName':'merchant','formName':'dataForm' ,'primaryKey':'Merchant_SerialNumber'})">
                </div>
                <div class="table_titel">
                    <div class="titel">商户管理</div>
                </div>
                <el-form :model="dataForm" ref="form" :inline-message="true" style="width: 100%">
                    <el-descriptions :column="2" size="large" border>
                        <el-descriptions-item>
                            <template slot="label">
                                <div class="cell-item required">上传营业执照</div>
                            </template>
                            <el-form-item prop="Picture_URL"
                                :rules="[{ required: true, message: '请上传营业执照', trigger: 'change' }]">
                                <yl-upload v-model="dataForm.Picture_URL"></yl-upload>
                            </el-form-item>
                        </el-descriptions-item>

                        <el-descriptions-item>
                            <template slot="label">
                                <div class="cell-item required">上传商户LOGO</div>
                            </template>
                            <el-form-item prop="Logo_URL"
                                :rules="[{ required: true, message: '请上传商户LOGO', trigger: 'change' }]">
                                <yl-upload v-model="dataForm.Logo_URL"></yl-upload>
                            </el-form-item>
                        </el-descriptions-item>

                        <el-descriptions-item :span="2">
                            <template slot="label">
                                <div class="cell-item required">信用代码</div>
                            </template>
                            <el-form-item prop="Merchant_SerialNumber"
                                :rules="[{ required: true, message: '请输入信用代码', trigger: 'blur' }]">
                                <el-input v-model.trim="dataForm.Merchant_SerialNumber" placeholder="请输入信用代码" />
                            </el-form-item>
                        </el-descriptions-item>
                        <el-descriptions-item :span="2">
                            <template slot="label">
                                <div class="cell-item required">商户名称</div>
                            </template>
                            <el-form-item prop="Merchant_Name"
                                :rules="[{ required: true, message: '请输入商户名称', trigger: 'blur' }]">
                                <el-input v-model.trim="dataForm.Merchant_Name" placeholder="请输入商户名称" />
                            </el-form-item>
                        </el-descriptions-item>
                        <el-descriptions-item :span="2">
                            <template slot="label">
                                <div class="cell-item required">码来源</div>
                            </template>
                            <el-form-item prop="Merchant_Source"
                                :rules="[{ required: true, message: '请输入码来源', trigger: 'change' }]">
                                <el-radio-group v-model="dataForm.Merchant_Source">
                                    <el-radio label="0">平台生码</el-radio>
                                    <el-radio label="1">企业自有码</el-radio>
                                </el-radio-group>
                            </el-form-item>
                        </el-descriptions-item>
                        <el-descriptions-item :span="2">
                            <template slot="label">
                                <div class="cell-item required">地址（省-市-区）</div>
                            </template>
                            <el-form-item prop="CountyNumber"
                                :rules="[{ required: true, message: '请选择地址', trigger: 'change' }]">
                                <el-cascader @change="changeCity" v-model.trim="dataForm.CountyNumber" filterable
                                    :props="{label:'name',value:'code',emitPath:false}" :options="city" clearable
                                    placeholder="请选择地址" style="width: 100%;"></el-cascader>
                            </el-form-item>
                        </el-descriptions-item>
                        <el-descriptions-item :span="2">
                            <template slot="label">
                                <div class="cell-item required">详细地址</div>
                            </template>
                            <el-form-item prop="Detailed_Address"
                                :rules="[{ required: true, message: '请输入详细地址', trigger: 'blur' }]">
                                <el-input :disabled="!dataForm.CountyNumber" v-model.trim="dataForm.Detailed_Address"
                                    placeholder="请输入详细地址"></el-input>
                            </el-form-item>
                        </el-descriptions-item>
                        <el-descriptions-item :span="2">
                            <template slot="label">
                                <div class="cell-item required">联系人</div>
                            </template>
                            <el-form-item prop="Contact_Person"
                                :rules="[{ required: true, message: '请输入联系人', trigger: 'blur' }]">
                                <el-input v-model.trim="dataForm.Contact_Person" placeholder="请输入联系人"></el-input>
                            </el-form-item>
                        </el-descriptions-item>
                        <el-descriptions-item :span="2">
                            <template slot="label">
                                <div class="cell-item required">联系电话</div>
                            </template>
                            <el-form-item prop="Contact_Phone"
                                :rules="[{ required: true, message: '请输入联系电话', trigger: 'blur' }]">
                                <el-input v-model.trim="dataForm.Contact_Phone" placeholder="请输入联系电话"></el-input>
                            </el-form-item>
                        </el-descriptions-item>

                        <el-descriptions-item :span="2">
                            <template slot="label">
                                <div class="cell-item required">备注</div>
                            </template>
                            <el-form-item prop="Memo"
                                :rules="[{ required: true, message: '请输入备注', trigger: 'blur' }]">
                                <el-input type="textarea" :autosize="{ minRows: 4}" v-model.trim="dataForm.Memo" placeholder="请输入备注"  maxlength="500" show-word-limit></el-input>
                            </el-form-item>
                        </el-descriptions-item>
                    </el-descriptions>
                </el-form>
            </div>
            <div class="footer">
                <el-button size="medium" @click="handleBack">返回</el-button>
                <el-button size="medium" type="primary" plain @click="handleSubmit" :loading="loading">提交</el-button>
            </div>
        </div>
    </div>

    <script type="text/javascript" src="../../../utils/wangeditor.js"></script>
    <script type="text/javascript" src="../../../utils/jquery.min.js"></script>
    <script type="text/javascript" src="../../../utils/jquery.cookie.js"></script>
    <script type="text/javascript" src="../../../utils/vue.min.js"></script>
    <script type="text/javascript" src="../../../utils/vuex.min.js"></script>
    <script type="text/javascript" src="../../../component/elementUI/index.js"></script>
    <script type="text/javascript" src="../../../utils/components.js"></script>
    <script type="text/javascript" src="../../../utils/compressor.js"></script>
    <script type="text/javascript" src="../../../utils/validity.js"></script>
    <script type="text/javascript" src="../../../utils/utils.js"></script>
    <script type="text/javascript" src="../../../utils/http.js"></script>
    <script type="text/javascript" src="js/add.js"></script>
</body>

</html>